package com.varteq.progress.shared;

import java.io.Serializable;

public final class ProgressChangeEvent implements Serializable {
	private static final long serialVersionUID = -1817818875670762715L;

	private String _description;
	private Double _percentage;
	private boolean _complete;
	private Serializable _data;

	@SuppressWarnings("unused")
	private ProgressChangeEvent() {
	}

	public ProgressChangeEvent(String description, Double percentage, boolean complete, Serializable data) {
		_description = description;
		_percentage = percentage;
		_complete = complete;
		_data = data;
	}

	public String getDescription() {
		return _description;
	}

	public Double getPercentage() {
		return _percentage;
	}

	public boolean isComplete() {
		return _complete;
	}

	/**
	 * Returns additional data available during or after the process.
	 * 
	 * @return Any serializable object with source code available for GWT compiler.
	 */
	public Serializable getData() {
		return _data;
	}

	@Override
	public String toString() {
		return _description + " - " + _percentage;
	}
}
